package com.flyduck.vueshop.order.remote.controller;

import com.flyduck.vueshop.common.core.lang.Result;
import com.flyduck.vueshop.common.sotoken.annotation.InnerAuth;
import com.flyduck.vueshop.order.remote.service.RemoteOrderService;
import com.flyduck.vueshop.order.vo.RemoteOrderRespVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * RemoteOrderController
 * </p>
 *
 * @author flyduck
 * @since 2024-07-23
 */
@RestController
@RequestMapping("/order/remote/order")
public class RemoteOrderController {

    @Resource
    private RemoteOrderService remoteOrderService;

    @InnerAuth
    @GetMapping("/getOrderById/{id}")
    public Result<RemoteOrderRespVO> getOrderDetailsById(@PathVariable("id") Long id){
        RemoteOrderRespVO remoteOrderRespVO = remoteOrderService.getOrderById(id);
        return Result.success(remoteOrderRespVO);
    }

}
